package com.haiqiu.tools.test.controller;

import com.haiqiu.tools.captcha.entity.Captcha;
import com.haiqiu.tools.captcha.utils.ImgVerifyCode;
import com.haiqiu.tools.common.utils.HttpServletUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * excel文档测试
 *
 * @author haiqiu
 * @date 2022/6/28
 */
@RestController
@RequestMapping("/captcha")
public class CaptchaController {

    @RequestMapping(value = "")
    public void getSkuList1() {
        Captcha captcha = ImgVerifyCode.generateCode();
        System.out.println(captcha.getCode());
        System.out.println(captcha.getUuid());
        System.out.println(captcha.getBase64());
        ImgVerifyCode.writeCodeToResponse(captcha.getBufferedImage(), HttpServletUtils.getServletResponse());
    }
}
